﻿namespace Worldme.YHChatSDK.Framework.Vo
{
    public class EventMsgVo
    {
        public string version { get; set; }
        /// <summary>
        /// 包括事件的基础信息
        /// </summary>
        public Header header { get; set; }
        /// <summary>
        /// 包括事件的内容。注意：Event对象的结构会在不同的eventType下发生变化
        /// </summary>
        public Event @event { get; set; }

    }

    public class Header
    {
        /// <summary>
        /// 事件ID，全局唯一
        /// </summary>
        public string eventId { get; set; }
        /// <summary>
        /// 事件产生的时间，毫秒13位时间戳
        /// </summary>
        public long eventTime { get; set; }
        /// <summary>
        /// 事件类型
        /// </summary>
        public string eventType { get; set; }
    }


    public class Event
    {
        /// <summary>
        /// 发送者的信息
        /// </summary>
        public Sender sender { get; set; }
        /// <summary>
        /// 聊天对象
        /// </summary>
        public Chat chat { get; set; }
        /// <summary>
        /// 消息内容
        /// </summary>
        public Message message { get; set; }

    }

    public class Sender
    {
        public string senderId { get; set; }
        public string senderType { get; set; }
        public string senderUserLevel { get; set; }
        public string senderNickname { get; set; }
    }

    public class Chat
    {
        public string chatId { get; set; }
        public string chatType { get; set; }
    }

    public class Message
    {
        public string msgId { get; set; }
        public string parentId { get; set; }
        public long sendTime { get; set; }
        public string chatId { get; set; }
        public string chatType { get; set; }
        public string contentType { get; set; }
        public Content content { get; set; }
        public int commandId { get; set; } = 0;
        public string? commandName { get; set; }

    }

    public class Content
    {
        public string? text { get; set; }
        public string? imageUrl { get; set; }
        public string? imageName { get; set; }
        public string? fileName { get; set; }
        public string? fileUrl { get; set; }
        public long fileSize { get; set; } = 0;
        public string? etag { get; set; }
    }
}
